/**
 * 
 */
package x10.log;

import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

/**
 * @author Denny Sheirer
 * @date   2011
 */
public class LoggingService {
    private Logger logger = Logger.getLogger("x10");
    private FileHandler serverFH;
    int maxLogFileSize = 100000;
    int maxLogCount = 1;
    
    public LoggingService(){
	logger.setLevel(Level.ALL);
	startServerLog();
    }
    
    private void startServerLog() {
	try{
	    serverFH = new FileHandler("logs//X10Event.log", maxLogFileSize, maxLogCount);
	    serverFH.setFormatter(new SimpleFormatter());
	    logger.addHandler(serverFH);
	    
	} catch (IOException ioe){
	    logger.warning("Unable to create server log file");
	}
    }

}
